package org.wicketstuff.servlet3;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.StatelessLink;
import org.apache.wicket.request.flow.RedirectToUrlException;
import org.apache.wicket.request.mapper.parameter.PageParameters;

/**
 * Homepage
 */
public class HomePage extends WebPage
{

	private static final long serialVersionUID = 1L;

	// TODO Add any page properties or variables here

	/**
	 * Constructor that is invoked when page is invoked without a session.
	 *
	 * @param parameters Page parameters
	 */
	public HomePage(final PageParameters parameters)
	{

		// Add the simplest type of label
		add(new Label("message",
				"If you see this message wicket is properly configured and running"));
		add(new StatelessLink<String>("secureExample")
		{
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick()
			{
				throw new RedirectToUrlException("/cms/index.html");
			}
		});

	}
}
